package pattern.cor;

import pattern.cor.handler.*;

/**
 * Created by boot on 8/30/15.
 */
public class PriceHandlerFactory {
    // FactoryMethod to create handler.
    public static PriceHanlder createPriceHandler() {
        PriceHanlder sales = new SalesHandler();
        PriceHanlder mgr = new SalesMgrHandler();
        PriceHanlder dir = new DirectorHandler();
        PriceHanlder vp = new VicePresidentHandler(); // VicePresident
        PriceHanlder ceo = new CEOHandler();
        sales.setSuccessor(mgr);
        mgr.setSuccessor(dir);
        dir.setSuccessor(vp);
        vp.setSuccessor(ceo);
        return sales;
    }
}
